package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.utils.HttpClientUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController("userShop")
@RequestMapping("/user/shop")
@Api(tags = "用户查询服务端状态功能")
public class ShopController {

    @Autowired
    private RedisTemplate redisTemplate;
    private final String KEY = "STOP_STATUS";

    @ApiOperation("获取服务端状态的功能")
    @GetMapping("/status")
    public Result getStatus() {
        log.info("正在执行获取服务端的状态功能........");
        ValueOperations valueOperations = redisTemplate.opsForValue();
        Object value = valueOperations.get(KEY);
        return Result.success(value);
    }
}
